@model LanDBom.Models.libray

@{
    ViewBag.Title = "Create";
    Layout = "~/Views/Shared/_Genertals.cshtml";
}

<h2>添加工艺</h2>

@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()

    <div class="form-horizontal">
        <hr />
        @Html.ValidationSummary(true, "", new { @class = "text-danger" })
        <div class="form-group">
            @Html.Label("编号")
            <div class="col-md-10">
                @*@Html.EditorFor(model => model.LB_bai, new { htmlAttributes = new { @class = "form-control" } })*@
                <input type="text" class="form-control" id="LB_bai" placeholder="名称" name="LB_bai" readonly="readonly">
                @Html.ValidationMessageFor(model => model.LB_bai, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            @Html.Label("工艺名")
            <div class="col-md-10">
                @Html.EditorFor(model => model.LB_fne, new { htmlAttributes = new { @class = "form-control" } })
                @Html.ValidationMessageFor(model => model.LB_fne, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            @Html.Label("工艺分类")
            <div class="col-md-10">
                @Html.DropDownList("ST_ID", null, htmlAttributes: new { @class = "form-control", })
                @Html.ValidationMessageFor(model => model.Steelmaking.ST_fne, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            @Html.Label("单位")
            <div class="col-md-10">
                @*@Html.EditorFor(model => model.LB_dan, new { htmlAttributes = new { @class = "form-control" } })*@
                <select id="LB_dan" name="LB_dan" class="form-control">
                    <option></option>
                    <option>模</option>
                    <option>/1000张/色</option>
                    <option>平方</option>
                    <option>KG</option>
                    <option>吨</option>
                </select>
                @Html.ValidationMessageFor(model => model.LB_dan, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            @Html.Label("价格")
            <div class="col-md-10">
                @Html.EditorFor(model => model.LB_jia, new { htmlAttributes = new { @class = "form-control" } })
                @Html.ValidationMessageFor(model => model.LB_jia, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            @Html.Label("损耗")
            <div class="col-md-10">
                @Html.EditorFor(model => model.LB_shun, new { htmlAttributes = new { @class = "form-control" } })
                @Html.ValidationMessageFor(model => model.LB_shun, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            <div class="col-md-offset-2 col-md-10">
                <input type="submit" value="添加" class="btn btn-default" />
            </div>
        </div>
    </div>
}

<div>
    @Html.ActionLink("返回列表", "Index")
</div>
@section scripts{
    <script src="~/Scripts/jquery-3.4.1.min.js"></script>
    <script src="~/Scripts/bootstrap.min.js"></script>
   <script>
       $(function () {
           randomGeneration()
           function randomGeneration() {
               //产生随机数
               var x = 1000000
               var y = 9999999
               var num = parseInt(Math.random() * (x - y + 1) + y)
               var now = new Date($.now());
               var afi = "BAM" +  num
               //写入随机申请单号
               $("#LB_bai").val(afi)
           }
       })
       
    </script>
}